﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
    class Student
    {
        public string lastName;
        public string initials;
        int[] marks = new int[10];
        public string group;

        public void EnterCredentials()
        {
            Console.WriteLine("введите фамилию, инициалы, группу через \"Enter\"");
            lastName = Console.ReadLine();
            initials = Console.ReadLine();
            group = Console.ReadLine();
            FillMarksArrayFromConsole();
        }

        public int[] FillMarksArrayFromConsole()
        {
            for (int i = 0; i < marks.Length; i++)
            {
                Console.WriteLine("введите {0} оценку", i + 1);
                marks[i] = Int32.Parse(Console.ReadLine());
            }
            return marks;
        }

        public void PrintStudentInfo()
        {
            Console.WriteLine(lastName);
            Console.WriteLine(initials);
            Console.WriteLine(group);
            Console.WriteLine(AverageMarkCount());
        }

        public double AverageMarkCount()
        {
            int sum = 0;

            for (int i = 0; i < marks.Length; i++) 
            {sum += marks[i]; }
            double averageMark = sum / marks.Length;
            return averageMark;
        }
    }
}
